#!/bin/bash

qemu-system-riscv64 \
	-machine virt \
	-m 8192 \
	-smp 6 \
	-drive if=none,file=./updater.img,format=raw,id=updater,index=3 \
	-device virtio-blk-device,drive=updater \
	-drive if=none,file=./system.img,format=raw,id=system,index=2 \
	-device virtio-blk-device,drive=system \
	-drive if=none,file=./vendor.img,format=raw,id=vendor,index=1 \
	-device virtio-blk-device,drive=vendor \
	-drive if=none,file=./userdata.img,format=raw,id=userdata,index=0 \
	-device virtio-blk-device,drive=userdata \
	-append "ip=dhcp loglevel=7 console=ttyS0,115200 init=init root=/dev/ram0 rw rootwait ohos.boot.hardware=visionfive default_boot_device=10007000.virtio_mmio sn=8823456789 ohos.required_mount.system=/dev/block/vdb@/usr@ext4@ro,barrier=1@wait,required ohos.required_mount.vendor=/dev/block/vdc@/vendor@ext4@ro,barrier=1@wait,required ohos.required_mount.data=/dev/block/vdd@/data@ext4@nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc@wait,reservedsize=104857600" \
	-kernel Image \
	-initrd ramdisk.img \
	-nographic \
	-vga none \
	-device virtio-gpu-pci,xres=320,yres=640,max_outputs=1,addr=08.0 \
	-vnc :20 \
	-device virtio-mouse-pci \
	-device virtio-keyboard-pci \
	-k en-us \
	-display sdl,gl=off
